<extend name="Layout:base_cart"/>
<block name="header">
	<link rel="stylesheet" href="__CSS__/cart.css" type="text/css">
	<script type="text/javascript" src="__JS__/cart1.js"></script>
</block>
<block name="body">
	<!-- 主体部分 start -->
	<div class="mycart w990 mt10 bc">
		<h2><span>我的购物车</span></h2>
		<table>
			<thead>
				<tr>
					<th class="col1">商品名称</th>
					<th class="col3">单价</th>
					<th class="col4">数量</th>	
					<th class="col5">小计</th>
					<th class="col6">操作</th>
				</tr>
			</thead>
			<tbody>
			<foreach name="cart" item="goods">
				<tr>
					<td class="col1"><a href="{:U('Goods/show',array('id'=>$goods['id']))}"><img src="<empty name="goods.logo">__IMG__/nopic.jpg<else />{:C('IMG_PATH')}{$goods.logo}</empty>" alt="" /><strong>{$goods.name}</strong></a></td>
					<td class="col3">￥<span>{$goods.shop_price}</span></td>
					<td class="col4">
						<a href="javascript:;" class="reduce_num"></a>
						<input type="text" name="amount" data-id="{$goods.id}" value="{$goods.amount}" class="amount"/>
						<a href="javascript:;" class="add_num"></a>
					</td>
					<td class="col5">
						￥<span>{$goods.s_total}</span>
					</td>
					<td class="col6"><a href="javascript:void(0);" class="delete">删除</a></td>
				</tr>
			</foreach>
			</tbody>
			<tfoot>
				<tr>
					<td colspan="6">购物金额总计： <strong>￥ <span id="total">{$total_price}</span></strong></td>
				</tr>
			</tfoot>
		</table>
		<div class="cart_btn w990 bc mt10">
			<a href="/" class="continue">继续购物</a>
			<a href="{:U('Cart/createOrder')}" class="checkout">结 算</a>
		</div>
	</div>
	<!-- 主体部分 end -->

	<div style="clear:both;"></div>
	</block>
<block name="footer">
	<script type="text/javascript">
		var ajax_url = "{:U('changeAmount')}";
	</script>
</block>